﻿<%@ Page CodeFileBaseClass="AliCMS.Lib.SystemModule.Privilege.List" %>
<section data-page="privilege" data-title="特权设置" data-lang="<%=ContentLang%>">
	<dl class="path1">
		<dt><span>您的位置：</span>特权设置</dt>
		<dd>
			<select data-class="<%=ContentLang%>Font" data-ali-widget="combo">
				<ali:List Object="Language" Source="Manager.Languages">
					<ali:Record>
						<%If Convert.ToString(Ab) == ContentLang%>
							<option value="<%=Ab%>" selected><%=[AliCMS.SystemModule.Alias.Language.Name + PageLang]%></option>
						<%Else%>
							<option value="<%=Ab%>"><%=[AliCMS.SystemModule.Alias.Language.Name + PageLang]%></option>
						<%EndIf%>
					</ali:Record>
				</ali:List>
			</select>
		</dd>
	</dl>
	<div class="ali-tabs sub-nav" data-height-style="fill" data-event="click">
		<div class="ali-tabs-header">
			<div class="ali-tabs-nav-container">
				<ul>
					<li><a href="list.aspx?Lang=<%=ContentLang%>" target="ali-navtab">角色列表</a></li>
					<li><a href="add.aspx?Lang=<%=ContentLang%>" target="ali-navtab">添加角色</a></li>
					<li class="ali-active"><a>特权设置</a></li>
				</ul>				
			</div>
		</div>
		<div class="ali-tabs-body">
			<div class="ali-tabs-panel"></div>
			<div class="ali-tabs-panel"></div>
			<div class="ali-tabs-panel">
				<form action="?ID=<%=Request.QueryString['ID']%>&Type=<%=Request.QueryString["Type"]%>" class="search1">
					角色：
					<select name="RoleID" data-class="<%=ContentLang%>Font" data-ali-widget="combo">
						<option value="">游客</option>
						<ali:List Object="Role">
							<ali:Record>
								<%If Guid.Equals(ID, CurrentRoleID)%>
									<option value="<%=ID%>" selected><%=Name%></option>
								<%Else%>
									<option value="<%=ID%>"><%=Name%></option>
								<%EndIf%>
							</ali:Record>
						</ali:List>
					</select>
					实例：
					<select name="InstanceID" data-class="<%=ContentLang%>Font" data-ali-widget="combo">
						<ali:List Object="Instance">
							<ali:Record>
								<%If Guid.Equals(ID, CurrentInstanceID)%>
									<option value="<%=ID%>" ModuleID="<%=ModuleID%>" selected><%=Name%></option>
								<%Else%>
									<option value="<%=ID%>" ModuleID="<%=ModuleID%>"><%=Name%></option>
								<%EndIf%>
							</ali:Record>
						</ali:List>
					</select>
					语言：
					<select name="CurrentLang" data-class="<%=ContentLang%>Font" data-ali-widget="combo">
						<ali:List Object="Language">
							<ali:Record>
								<%If Guid.Equals(ID, CurrentLang)%>
									<option value="<%=Ab%>" selected><%=Name%></option>
								<%Else%>
									<option value="<%=Ab%>"><%=Name%></option>
								<%EndIf%>
							</ali:Record>
						</ali:List>
					</select>
					<button type="submit" style="display:none"></button>
					<button type="button" data-name="Save" class="ali-button">保 存</button>
				</form>
				<ul class="toolbar1">
					<li class="select-all"><a><span>全选</span></a></li>
					<li class="select-reverse"><a><span>反选</span></a></li>
				</ul>
				<div class="content">
					<table data-ali-widget="grid" class="grid1">
						<thead>
							<tr>
								<th>对象</th>
								<th>特权</th>
							</tr>
						</thead>
						<tbody>
							<ali:List ID="ObjectTableID" Object="Module.Object" Source="ObjectTable">
								<ali:Record>
									<tr data-id="<%=InnerID%>" ItemID="<%=InnerID%>">
										<th><label class="<%=ContentLang%>Font"><input type="checkbox" name="ObjectID"><%=Label%></label></th>
										<td style="text-align:left">
											<ali:List Object="Module.Object.Operation" Condition="ObjectID=ID">
												<ali:Record>
													<%If HasPrivilege(Record)%>
														<label class="<%=ContentLang%>Font"><input type="checkbox" name="OperationID" value="<%=ID%>" data-id="<%=GetPrivilegeID(Record)%>" data-object-id="<%=ObjectTableID[ID]%>" data-object-name="<%=ObjectTableID["FullName"]%>" data-operation-name="<%=Name%>" checked><%=Name%></label>
													<%Else%>
														<label class="<%=ContentLang%>Font"><input type="checkbox" name="OperationID" value="<%=ID%>" data-id="<%=GetPrivilegeID(Record)%>" data-object-id="<%=ObjectTableID[ID]%>" data-object-name="<%=ObjectTableID["FullName"]%>" data-operation-name="<%=Name%>"><%=Name%></label>
													<%EndIf%>
												</ali:Record>
											</ali:List>
										</td>
									</tr>
								</ali:Record>
							</ali:List>
						</tbody>
					</table>
				</div>
			</div>
		</div>
		<div class="ali-tabs-bottom"><b></b></div>
	</div>
</section>